<!doctype html>
<html>
<head>
    <!--Setting-->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="apple-mobile-web-app-capable"  content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no">
    
    
    <!--Simple SEO-->


<meta name="robots" content=all />
<meta name="google" content=all />
<meta name="googlebot" content=all />
<meta name="verify" content=all />
    <!--Title-->

<title>MIAbon&#39;s blog</title>

<link rel="alternate" href="/atom.xml" title="MIAbon&#39;s blog" type="application/atom+xml">


<link rel="icon" href="/favicon.ico">

    
<link rel="stylesheet" href="/css/base.css">
<link rel="stylesheet" href="/css/pages/article-exp.css">
<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/thirdParty/highlight/github.css">

    <!--script-->


<script src="http://cdn1.lncld.net/static/js/3.2.1/av-min.js"></script>
<script>
  var appId = "i7AHmC7NPbPtgS3YxT67dRIc-9Nh9j0Va";
  var appKey = "g6TKbY8O4TsCDMcemoC3STvQ";
  var region = "";
  AV.init({
    appId: appId,
    appKey: appKey,
    region: region
  });
</script>


<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<!--<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>-->


    
    
</head>

<body id="normal">
<!--[if lte IE 8]>
<style>
    html{ font-size: 1em }
</style>
<![endif]-->
<!--[if lte IE 9]>
<style>
    header{ top: 71px; position: absolute!important;}
    #container{padding-top: 151px!important;}
</style>
<div style="position:fixed;z-index:9999;left:0;top:0;width:100%;height:70px;background-color:#e0e0e0;color:#396CA5;border-bottom:1px solid #cecece;text-align:center;line-height:70px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis">你使用的浏览器版本过低，为了你更好的阅读体验，请更新浏览器的版本或者使用其他现代浏览器，比如Chrome、Firefox、Safari等。</div>
<![endif]-->

<div id="wrap">
    <header >
    <div id="site-meta">
        <a href="/" id="logo">
            <h1 class="title">MIAbon&#39;s blog</h1>
        </a>
        
    </div>
    <ul id="nav">
        
            <li><a href="/"><i class="fa fa-home"></i>首页</a></li>
        
            <li><a href="/atom.xml"><i class="fa fa-rss"></i>RSS</a></li>
        
        <li id="search"><a href="javascript:void(0)"><i class="fa fa-search"></i>搜索</a></li>
    </ul>
</header>

    <div id="container">
        
<ul id="sidebar">
    
    
    
    
<li class="widget widget-normal category">
    <h3 class="fa fa-th widget-title">分类</h3>
    <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/ELK/"><i class="fa" aria-hidden="true">ELK</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Lvs/"><i class="fa" aria-hidden="true">Lvs</i></a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/admin/"><i class="fa" aria-hidden="true">admin</i></a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/ansible/"><i class="fa" aria-hidden="true">ansible</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/aws/"><i class="fa" aria-hidden="true">aws</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/docker/"><i class="fa" aria-hidden="true">docker</i></a><span class="category-list-count">7</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/drone/"><i class="fa" aria-hidden="true">drone</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/kernel/"><i class="fa" aria-hidden="true">kernel</i></a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/kubernetes/"><i class="fa" aria-hidden="true">kubernetes</i></a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/kvm/"><i class="fa" aria-hidden="true">kvm</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mongodb/"><i class="fa" aria-hidden="true">mongodb</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link current" href="/categories/python/"><i class="fa" aria-hidden="true">python</i></a><span class="category-list-count">9</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/share/"><i class="fa" aria-hidden="true">share</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/web/"><i class="fa" aria-hidden="true">web</i></a><span class="category-list-count">12</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/zabbix/"><i class="fa" aria-hidden="true">zabbix</i></a><span class="category-list-count">3</span></li></ul>
</li>


    
    
<li class="widget widget-normal archive">
  <h3 class="fa fa-archive widget-title">归档</h3>
    <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/"><i class="fa" aria-hidden="true">二月 2018</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/01/"><i class="fa" aria-hidden="true">一月 2018</i></a><span class="archive-list-count">8</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/"><i class="fa" aria-hidden="true">十二月 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/11/"><i class="fa" aria-hidden="true">十一月 2017</i></a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/10/"><i class="fa" aria-hidden="true">十月 2017</i></a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/09/"><i class="fa" aria-hidden="true">九月 2017</i></a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/08/"><i class="fa" aria-hidden="true">八月 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/05/"><i class="fa" aria-hidden="true">五月 2017</i></a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/04/"><i class="fa" aria-hidden="true">四月 2017</i></a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/03/"><i class="fa" aria-hidden="true">三月 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/01/"><i class="fa" aria-hidden="true">一月 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/12/"><i class="fa" aria-hidden="true">十二月 2016</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/11/"><i class="fa" aria-hidden="true">十一月 2016</i></a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/10/"><i class="fa" aria-hidden="true">十月 2016</i></a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/"><i class="fa" aria-hidden="true">八月 2016</i></a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/05/"><i class="fa" aria-hidden="true">五月 2016</i></a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/"><i class="fa" aria-hidden="true">四月 2016</i></a><span class="archive-list-count">8</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/05/"><i class="fa" aria-hidden="true">五月 2015</i></a><span class="archive-list-count">1</span></li></ul>
</li>


    
    
<li class="widget widget-normal tags">
  <h3 class="fa fa-tags widget-title">标签云</h3>
  <div class="tagcloud-content">
    
      <a href="/tags/drone/" style="font-size: 0.14rem; color: #69c">drone</a> <a href="/tags/linux/" style="font-size: 0.2rem; color: #0a407c">linux</a> <a href="/tags/kernel/" style="font-size: 0.16rem; color: #4f83b8">kernel</a> <a href="/tags/ELK/" style="font-size: 0.14rem; color: #69c">ELK</a> <a href="/tags/ansible/" style="font-size: 0.14rem; color: #69c">ansible</a> <a href="/tags/swarm/" style="font-size: 0.14rem; color: #69c">swarm</a> <a href="/tags/docker/" style="font-size: 0.18rem; color: #215690">docker</a> <a href="/tags/firewalld/" style="font-size: 0.14rem; color: #69c">firewalld</a> <a href="/tags/zabbix/" style="font-size: 0.16rem; color: #4f83b8">zabbix</a> <a href="/tags/aws/" style="font-size: 0.14rem; color: #69c">aws</a> <a href="/tags/web/" style="font-size: 0.16rem; color: #4f83b8">web</a> <a href="/tags/python/" style="font-size: 0.18rem; color: #215690">python</a> <a href="/tags/spider/" style="font-size: 0.17rem; color: #386da4">spider</a>
  </div>
</li>


    
    
<li class="widget widget-normal friends-link">
    <h3 class="fa fa-globe widget-title">友链</h3><br/>

    
        <a href="http://zhengwei666.wang" class="fa" target="_blank">zhengwei</a>

    
        <a href="https://you-deng.github.io" class="fa" target="_blank">dengyou</a>

    
        <a href="http://www.systemd.cn" class="fa" target="_blank">langyaoliang</a>

    
        <a href="http://www.chen-hao.com.cn/" class="fa" target="_blank">chenhao</a>

    
        <a href="http://www.yulongjun.com" class="fa" target="_blank">yulongjun</a>

    

</li>

    
</ul>


        <ul id="main">
    

    
    
    
    
    
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/02/10/docker_daemon_json/">
        <div class="article-img img-ajax" data-src= /img/default-1.jpg>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/02/10/docker_daemon_json/">
                <h2 class="article-title">docker daemon.json</h2>
            </a>
            
            <p class="article-content">
                常用的加速123456&#123;  &quot;registry-mirrors&quot;: [        &quot;https://registry.docker-cn.com&quot;,        &quot;https://docker.mirrors.ustc.edu.cn&quot;    ],&#125;
设置 镜像、容器、卷 存放目录和驱动1234&#123;    &quot;graph&quot;: &quot;/mnt/docker_data&quot;,    &quot;storage-driver&quot;: &quot;overlay2&quot;&#125;
graph : 设置存放目录storage-driver: 设置存储驱动
日志12345&#123;  &quot;log-driver&quot;: &quot;json-fil...
            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>docker</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            docker
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/02/10</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="docker daemon.json"
              data-leadcloud-url="/2018/02/10/docker_daemon_json/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/02/10/docker_daemon_json/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/01/20/pachong_test/">
        <div class="article-img img-ajax" data-src= http://backup-miabon.oss-cn-hongkong.aliyuncs.com/img/mongo_lagou.png>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/01/20/pachong_test/">
                <h2 class="article-title">爬虫 测试</h2>
            </a>
            
            <p class="article-content">
                

            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>python</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            python
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/01/20</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="爬虫 测试"
              data-leadcloud-url="/2018/01/20/pachong_test/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/01/20/pachong_test/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/01/15/qrcode_url_logo/">
        <div class="article-img img-ajax" data-src= http://www.geasslinks.com/img/createlogo.png>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/01/15/qrcode_url_logo/">
                <h2 class="article-title">输入网址加上logo生成二维码</h2>
            </a>
            
            <p class="article-content">
                1234567891011121314151617181920212223242526272829303132333435363738394041424344#!encoding: utf-8# url + py + logo 生成二维码# 运行python *.py www.baidu.com# logo.png放在同一文件夹from PIL import Imageimport qrcode, sys# 初步生成二维码图像qr = qrcode.QRCode(version=5,error_correction=qrcode.constants.ERROR_CORRECT_H,box_size=8,border=4)url = sys.argv[1]qr.add_data("http://" + url)qr.make(fit=True)# 获得Image实例并把颜色模式转换为R...
            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>python</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            python
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/01/15</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="输入网址加上logo生成二维码"
              data-leadcloud-url="/2018/01/15/qrcode_url_logo/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/01/15/qrcode_url_logo/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/01/10/request使用代理/">
        <div class="article-img img-ajax" data-src= /img/default-1.jpg>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/01/10/request使用代理/">
                <h2 class="article-title">requests使用代理</h2>
            </a>
            
            <p class="article-content">
                123456789101112131415161718192021222324252627#!encoding: utf-8import requests,randomurl = 'http://members.3322.org/dyndns/getip'#用了一个找的免费代理池url_ip = 'http://192.168.11.250:5010/get'ip = requests.get(url_ip).text# proxy = ["http://125.67.75.53:9000",#          "http://117.90.0.141:9000",#          "http://121.232.194.14:9000"#          ]# for i in range(3):#     proxies = &#123;#         "http":...
            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>python</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            python
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/01/10</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="requests使用代理"
              data-leadcloud-url="/2018/01/10/request使用代理/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/01/10/request使用代理/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/01/10/debug_python/">
        <div class="article-img img-ajax" data-src= /img/default-1.jpg>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/01/10/debug_python/">
                <h2 class="article-title">debug</h2>
            </a>
            
            <p class="article-content">
                1234567import pdbdef make_bread():    pdb.set_trace()    return "I don't have time"print(make_bread())
或者1$ python -m pdb debug.py

c :继续执行
w :显示当前正在执行代码行的上下文信息
a :打印当前函数的参数列表
s :执行当前代码行,并停在第一个能停的地方
n :继续执行到当前函数的下一行,或者当前行直接返回


            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>python</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            python
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/01/10</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="debug"
              data-leadcloud-url="/2018/01/10/debug_python/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/01/10/debug_python/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/01/10/args和kwargs/">
        <div class="article-img img-ajax" data-src= /img/default-1.jpg>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/01/10/args和kwargs/">
                <h2 class="article-title">*args和**kwargs</h2>
            </a>
            
            <p class="article-content">
                *args12345def var_args(f, *args):    print("first normal arg:", f)    for arg in args:        print("another arg through *args:", arg)        print(type(args))
var_args(‘1’, ‘2’, ‘3’, ‘4’)first normal arg: 1another arg through *args: 2
another arg through *args: 3
another arg through *args: 4


**kwargs123def get_kw(**kwargs):    for key, value in kwargs.items():        print("&#123;0&#125; == ...
            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>python</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            python
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/01/10</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="*args和**kwargs"
              data-leadcloud-url="/2018/01/10/args和kwargs/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/01/10/args和kwargs/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/01/03/aliyunsdk/">
        <div class="article-img img-ajax" data-src= /img/default-1.jpg>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/01/03/aliyunsdk/">
                <h2 class="article-title">aliyun python sdk ecs</h2>
            </a>
            
            <p class="article-content">
                安装pyhton sdk123456# 安装阿里云 SDK 核心库pip install aliyun-python-sdk-core-v3# 安装管理 ECS 的库pip install aliyun-python-sdk-ecs# 安装管理 RDS 的库pip install aliyun-python-sdk-rds
使用SDK导入使用的模块12345from aliyunsdkcore.client import AcsClientfrom aliyunsdkcore.acs_exception.exceptions import ClientExceptionfrom aliyunsdkcore.acs_exception.exceptions import ServerExceptionfrom aliyunsdkecs.request.v20140526 import ...
            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>python</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            python
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/01/03</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="aliyun python sdk ecs"
              data-leadcloud-url="/2018/01/03/aliyunsdk/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/01/03/aliyunsdk/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/01/02/User-Agent/">
        <div class="article-img img-ajax" data-src= /img/default-1.jpg>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/01/02/User-Agent/">
                <h2 class="article-title">简单实用的useragent</h2>
            </a>
            
            <p class="article-content">
                爬虫中具体使用方法1234import fake_useragentua = fake_useragent.UserAgent()headers = &#123;'User-Agent': ua.random&#125;print(headers)
{‘User-Agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36’}{‘User-Agent’: ‘Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36’}{‘Use...
            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>python</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            python
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/01/02</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="简单实用的useragent"
              data-leadcloud-url="/2018/01/02/User-Agent/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/01/02/User-Agent/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2018/01/01/maoyan_top100/">
        <div class="article-img img-ajax" data-src= /img/default-1.jpg>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2018/01/01/maoyan_top100/">
                <h2 class="article-title">简单爬虫猫眼TOP100</h2>
            </a>
            
            <p class="article-content">
                1234567891011121314import requests,timefrom lxml import etreefor i in range(0, 91, 10):    url = 'https://maoyan.com/board/4?offset=' + str(i)    r = requests.get(url).text    s = etree.HTML(r)    print(s.xpath('//*[@id="app"]/div/div/div[1]/dl/dd/div/div/div[1]/p[1]/a/text()'))    time.sleep(5)
[‘霸王别姬’, ‘肖申克的救赎’, ‘罗马假日’, ‘这个杀手不太冷’, ‘教父’, ‘泰坦尼克号’, ‘龙猫’, ‘唐伯虎点秋香’, ‘千与千寻’, ‘魂断蓝桥’][‘天空之城’, ‘乱世佳人’,...
            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>python</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            python
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2018/01/01</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="简单爬虫猫眼TOP100"
              data-leadcloud-url="/2018/01/01/maoyan_top100/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2018/01/01/maoyan_top100/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    
    <li  class="article-excerpt-wrap " _href = "/2017/12/02/ansiable/">
        <div class="article-img img-ajax" data-src= /img/default-1.jpg>
           <div class="loading-img"><i class="fa fa-pulse fa-spinner"></i></div>
        </div>
        <div class="article-excerpt">
            
            <a class="article-title-link" href="/2017/12/02/ansiable/">
                <h2 class="article-title">ansible基础</h2>
            </a>
            
            <p class="article-content">
                Ansible配置文件配置文件说明12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216...
            </p>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>ansible</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            ansible
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2017/12/02</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="ansible基础"
              data-leadcloud-url="/2017/12/02/ansiable/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
    <a href="/2017/12/02/ansiable/" class="read-article">阅读全文</a>
    
</div>

        </div>
        
    </li>
    
    

</ul>

<div id="page-pagination">
    <div id="page-nav">
        <span class="extend disable prev" rel="prev">&laquo; Prev</span><span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="page-number" href="/page/3/">3</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/">5</a><a class="extend next" rel="next" href="/page/2/">Next &raquo;</a>
    </div>
</div>

    </div>
    <footer id="footer">
    
    <div class="social">
        
        <a href="https://www.example1.com" class="fa fa-free-code-camp" target="_blank" title="freecodecamp"></a>
        
        <a href="https://github.com/werewolf2101" class="fa fa-github" target="_blank" title="Follow me~"></a>
        
        <a href="mailto:werewolf2101@gmail.com" class="fa fa-email" target="_blank" title="Email"></a>
        
    </div>
    
    <div>
        
        <a href="/" class="copyright-links">MIAbon</a>&copy;2015 - 2018.All Rights
        Reserved.
    </div>
    <p>Powered by <a href="https://hexo.io" class="copyright-links" target="_blank">Hexo</a> | Theme by <a
                href="https://github.com/GeekaholicLin" class="copyright-links" target="_blank">GeekaholicLin</a>
    </p>
    
    
    <p>
        <span id="busuanzi_container_site_uv" class="fa fa-bar-chart">
        欢迎第<span id="busuanzi_value_site_uv"><i class="fa fa-spinner fa-spin"></i></span>位小伙伴~
        </span>
    </p>
    
</footer>

</div>
    <ul id="tools">
    <li class="totop-btn fa fa-angle-up"></li>
    <li class="exchange-btn fa fa-exchange"></li>
  
    

    
</ul>
<p id="process"></p>
<div id="search-overlay">
    <div class="search-area-wrap">
        <div id="search-area">
            <div class="input-wrap focus">
                <i class="fa fa-search" aria-hidden="true"></i>
                <input id="search-input" autofocus autocomplete="off" type="text"
                       placeholder="search this website..."/>
            </div>
            <ul id="search-result">
                <li class="load-first"><i class="fa fa-spinner fa-pulse"></i></li>
            </ul>
        </div>
    </div>
</div>


    <script src="/js/highsong.js"></script>



<script src="/js/search.js"></script>
<script type="text/javascript">
    //theme config datas
    var copyrightObj = {};
    copyrightObj.enable = 'true';
    copyrightObj.triggerCopyLength = '200';
    copyrightObj.appendText = '商业转载请联系作者获得授权,非商业转载请注明出处 © gasslinks.com';
    var leancloudObj = {};
    leancloudObj.enable = 'true';
    leancloudObj.className = 'blog';
    leancloudObj.limits = '5';
</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?dfebe5842f5d4196471b84802392a4b2";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/javascript">
    var search = {};
    var search_path = "search.xml";
    if (!search_path) {
        search_path = "search.xml";
    }
    search.path = "/" + search_path;
    search.func =  _ajax.init();
</script>
<script src="/js/app.js"></script>


</body>
</html>